package com.rachel.testjetpack.livedata;

import androidx.annotation.NonNull;
import androidx.lifecycle.ViewModel;
import androidx.lifecycle.ViewModelProvider;

import com.rachel.testjetpack.viewmodel.Main3ActivityViewModel;

public class Main4ActivityViewModelFactory implements ViewModelProvider.Factory {

    private int count;

    public Main4ActivityViewModelFactory(int count) {
        this.count = count;
    }

    @NonNull
    @Override
    public <T extends ViewModel> T create(@NonNull Class<T> modelClass) {
        return (T) new Main4ActivityViewModel(count);
    }
}